<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<!--
    解构赋值  对象  数组
-->


<script>

    let arr = [1, 2, 3, 4]
    let arr2 = [10, 20, 30, 40]

    console.log(arr[0])
    console.log(arr[1])
    console.log(arr[2])
    console.log(arr[3])

    console.log('------------------------')
    let [a, b, c, d] = [1, 2, 3, 4]
    console.log(a)
    console.log(b)
    console.log(c)
    console.log(d)

    console.log('------------------------')
    let arr3 = [
        ...arr,
        ...arr2
    ]
    console.log(arr3.toString())

    console.log("---------------------------------")
    let user = {
        name: 'lisi',
        age: 20,
        sex: '男'
    }

    console.log(user.age)
    console.log(user.name)
    console.log(user.sex)
    console.log("---------------------------------")

    let {name:username,age,sex} = user
    console.log(username)
    console.log(age)
    console.log(sex)




</script>
</body>
</html>